﻿using System;
using System.Collections.Generic;
using System.Text;

namespace OPCDiffCore
{
    /// <summary>
    /// Strongly type DiffElement collection.
    /// </summary>
    internal class DiffElementCollection : List<DiffElement>
    {
        public int CountRemovedElement
        {
            get
            {
                int retCount = 0;
                foreach (DiffElement diffElem in this)
                    if (diffElem.ActionType == DiffType.Removed)
                        ++retCount;
                return retCount;
            }
        }

        public int CountAddedElement
        {
            get
            {
                int retCount = 0;
                foreach (DiffElement diffElem in this)
                    if (diffElem.ActionType == DiffType.Added)
                        ++retCount;
                return retCount;
            }
        }

        public int CountModifiedElement
        {
            get
            {
                int retCount = 0;
                foreach (DiffElement diffElem in this)
                    if (diffElem.ActionType == DiffType.Modified)
                        ++retCount;
                return retCount;
            }
        }
    }
}
